<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
    test(() => assert_selection(
        [
            '<div contenteditable>',
                '<div><span>|</span></div>',
            '</div>',
        ].join(''),
        selection => {
            selection.document.execCommand('insertText', false, 'x');
            selection.document.execCommand('delete');
        },
        '<div contenteditable><div><span>|</span></div></div>'),
        'Should not crash after typing one character then delete it');
</script>
